import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import org.junit.Test;

import javax.security.auth.login.Configuration;

import java.io.IOException;

import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;


public class WireMock {
    @Test
   public void mock() throws IOException {
        WireMockServer wireMockServer = new WireMockServer(
                wireMockConfig()
                        .port(8080)
                        .extensions(new ResponseTemplateTransformer(true))
        );

        wireMockServer.start();

        stubFor(
                get(urlPathEqualTo("/a/b/c"))
                        .withQueryParam("id",equalTo("1"))
                        .willReturn(aResponse()
                                .withBody("files/{{request.query.id}}.png"))
        );
        System.in.read();

        wireMockServer.stop();

    }
}
